//*******************************************************重写RadioGroup****************************************	    
				Ext.override(Ext.form.RadioGroup, {     
				    getValue: function(){     
				        var v;     
				        if (this.rendered) {     
				            this.items.each(function(item){     
				                if (!item.getValue())      
				                    return true;     
				                v = item.getRawValue();     
				                return false;     
				            });     
				        }     
				        else {     
				            for (var k in this.items) {     
				                if (this.items[k].checked) {     
				                    v = this.items[k].inputValue;     
				                    break;     
				                }     
				            }     
				        }
				        
				        return v;     
				    },     
				    setValue: function(v){     
				        if (this.rendered)      
				            this.items.each(function(item){     
				                item.setValue(item.getRawValue() == v);   
				            });     
				        else {     
				            for (var k in this.items) {     
				                this.items[k].checked = this.items[k].inputValue == v;     
				            }     
				        } 
				        
				    }     
				}); 

/** **************** 新增图表方法 ******************* */
				function add_chart_fun(fparentBh, fparentName, tree_op) {

					var pxgz_combox = new top.Ext.form.ComboBox({
						id : 'tblx_id',
						name : 'tblx_id',
						mode : 'local',
						fieldLabel : '图表类型',
						valueField : 'tblx_id',
						displayField : 'tblx_name',
						triggerAction : 'all',
						width : 150,
						store : new Ext.data.SimpleStore( {
							fields : [ 'tblx_id', 'tblx_name' ],
							data : [ [ 1, '柱状图' ],
								     [ 2, '仪表盘' ], 
								     [ 3, '单折线' ], 
								     [ 4, '横向直线' ], 
								     [ 5, '饼图' ],
								     [ 6, '金字塔' ],
								     [ 7, '漏斗图' ],
								     [ 8, '温度计' ],
								     [ 9, '多折线' ],
								     [ 10, '多序列柱状图 ' ],
								     [ 11, '柱状、折线联合图 ' ],
								     [ 12, '甘特图 ' ]
							] 
						})
					});  
					
					var drill_type_Radio = new top.Ext.form.RadioGroup({
                       id:'drill_type_radio_id',
					   style:'width:80px; display: block;text-align:left;line-height:22px;',
					   height:20,
					   
       				   fieldLabel : '展现形式',
                       columns : 2,
                       vertical :true,
                       items:[
                              {boxLabel:'图表',inputValue:'1',name:'frela_type',checked: true},
                              {boxLabel:'报表',inputValue:'2',name:'frela_type'}],
				        listeners : {
				        	'change' : function(rg, checked){
				        		drill_type_Radio.getEl().dom.readOnly = checked.getGroupValue() == 'yes' ? false : true;
						}}
			    });
					
					//钻取依据
					var zqyj_combox = new top.Ext.form.ComboBox({
						id : 'zqyj_id',
						name : 'zqyj_id',
						mode : 'local',
						fieldLabel : '钻取依据',
						valueField : 'zqyj_id',
						displayField : 'zqyj_name',
						triggerAction : 'all',
						width : 150,
						store : new Ext.data.SimpleStore( {
							fields : [ 'zqyj_id', 'zqyj_name' ],
							data : [ [ 1, '日期' ],
							         [ 2, ' 日期-年' ],
								     [ 3, ' 日期-季度' ], 
								     [ 4, ' 日期-月度' ], 
								     [ 5, ' 日期-天' ], 
								     [ 8, '科室' ]
							] 
						})
					});  
					
					var fxOpen_obj = new top.Ext.form.RadioGroup({
						                       id:'ffx_open_id',
											   style:'width:80px; display: block;text-align:left;line-height:22px;',
											   height:20,
						       				   fieldLabel : '文字分析',
						                       columns : 2,
						                       vertical :true,
						                       items:[
						                              {boxLabel:'关闭',inputValue:'2',name:'ffx_open',checked: true},
						                              {boxLabel:'开启',inputValue:'1',name:'ffx_open'}],
										        listeners : {
										        	'change' : function(rg, checked){
										        		fxOpen_obj.getEl().dom.readOnly = checked.getGroupValue() == 'yes' ? false : true;
												}}
									    });
									    
					var fxBh_obj = new top.Ext.form.RadioGroup({
						                       id:'ffx_bh_id',
											   style:'width:100px; display: block;text-align:left;line-height:22px;',
											   height:20,
						       				   fieldLabel : '分析策略',
						                       columns : 2,
						                       vertical :true,
						                       items:[
						                              {boxLabel:'向下利好',inputValue:'2',name:'ffx_bh',checked: true},
						                              {boxLabel:'向上利好',inputValue:'1',name:'ffx_bh'}],
										        listeners : {
										        	'change' : function(rg, checked){
										        		fxBh_obj.getEl().dom.readOnly = checked.getGroupValue() == 'yes' ? false : true;
												}}
									    });
					
					var type_obj = new top.Ext.form.RadioGroup({
						                       id:'type_radio_id',
											   style:'width:180px; display: block;text-align:left;line-height:22px;',
											   height:20,
						       				   fieldLabel : '节点类型',
						                       columns : 2,
						                       vertical :true,
						                       items:[
						                              {boxLabel:'图表',inputValue:'1',name:'ftype',checked: true},
						                              {boxLabel:'图表类别',inputValue:'2',name:'ftype'}],
										        listeners : {
										        	'change' : function(rg, checked){
										        		type_obj.getEl().dom.readOnly = checked.getGroupValue() == 'yes' ? false : true;
												}}
									    })    
									    
					var drillOpen_obj = new top.Ext.form.RadioGroup({
						                       id:'ftable_radio_id',
											   style:'width:100px; display: block;text-align:left;line-height:22px;',
											   height:20,
						       				   fieldLabel : '钻取开关',
						                       columns : 2,
						                       vertical :true,
						                       items:[
						                              {boxLabel:'关闭',inputValue:'2',name:'frela_open',checked: true},
						                              {boxLabel:'开启',inputValue:'1',name:'frela_open'}],
										        listeners : {
										        	'change' : function(rg, checked){
										        		drillOpen_obj.getEl().dom.readOnly = checked.getGroupValue() == 'yes' ? false : true;
												}}
									    })
									    
					var chart_form = new top.Ext.form.FormPanel(
							{
								frame : true,
								url : 'reportInfo!saveReportInfo.do',
								method : 'POST',
								labelWidth : 70,
								waitMsgTarget : true,
								layout : "column",
								items : [ {
									columnWidth : 0.4,
									autoHeight : true,
									layout : "form",
									anchor : '99%',
									items : [ {
											fieldLabel : '当前操作',
											html : '在<font color=red>' + fparentName + '</font>下新增节点'
										}, type_obj,
										{
											xtype : 'textfield',
											fieldLabel : '图表编号',
											name : 'fbh',
											readOnly : false,
											allowBlank : true,
											value : 'MCD',
											width : 150
										}, {
											xtype : 'textfield',
											fieldLabel : '图表名称',
											name : 'fname',
											readOnly : false,
											allowBlank : true,
											emptyText : '',
											blankText : '',
											width : 150
										}, pxgz_combox , {
											xtype : 'numberfield',
											fieldLabel : '标准值',
											name : 'ftarget',
											width : 150
										},
										fxOpen_obj ,
										fxBh_obj , 
										drillOpen_obj , 
										drill_type_Radio , {
											xtype : 'textfield',
											fieldLabel : '钻取图表或报表编号',
											name : 'frela_bh',
											readOnly : false,
											allowBlank : true,
											width : 150
										}, zqyj_combox, {
											xtype : 'hidden',
											name : 'fflag',
											value : '99' //图表单元
										}, {
											xtype : 'hidden',
											name : 'fparent',
											value : fparentBh
										}, {
											xtype : 'hidden',
											name : 'fchart_style',
											id : 'fchart_style_id'
										}, {
											xtype : 'hidden',
											name : 'frela_yj',
											id : 'frela_yj_id'
										} ]
								}, {
									columnWidth : 0.6,
									autoHeight : true,
									layout : "form",
									labelWidth : 60,
									labelAlign : 'left',
									anchor : '99%',
									items : [  {
											html : '文字分析参考值： ',
											width : 350
										}, {
											html : '　　统计结果总数：total',
											width : 350
										}, {
											html : '　　统计结果平均值：average',
											width : 350
										},{
											html : '　　低于标准值对象个数：obj_num_under',
											width : 350
										},{
											html : '　　高于标准值对象个数：obj_num_above',
											width : 350
										},{
											html : '　　低于标准值对象描述：obj_desc_under',
											width : 350
										},{
											html : '　　高于标准值对象描述：obj_desc_above',
											width : 350
										},{
											html : '　　统计对象总个数：obj_num_all',
											width : 350
										},{
											html : '　　统计对象达标率：rate',
											width : 350
										},{
											html : '　　　    ',
											width : 350
										}, { 
											xtype : 'textarea',
											fieldLabel : '分析内容',
											name : 'fdesc',
											readOnly : false,
											allowBlank : true,
											height : 200,
											width : 350
										} ]
								} ]
								
							});

							
					var btn_sure_add_chart = new top.Ext.Button({
						text : '确定',
						iconCls : 'sy-sure',
						handler : function() {
							//alert(top.Ext.getCmp("tblx_id").value);
							top.Ext.get("fchart_style_id").dom.value = top.Ext.getCmp("tblx_id").value;
							top.Ext.get("frela_yj_id").dom.value = top.Ext.getCmp("zqyj_id").value;
							//alert(top.Ext.get("fchart_style_id").dom.value);
							//return false;
						var frm = chart_form.getForm();
							if (frm.isValid()) {
								frm.submit({
									waitTitle : '请稍候',
									waitMsg : '正在提交表单数据,请稍候...',
									success : function(form, action) {
										add_chart_window.close();
										tree_op.root.reload();
										top.Ext.Msg.alert('', '保存成功！');
										
									},
									failure : function(form, action) {
										add_chart_window.close();
										tree_op.root.reload();
										top.Ext.Msg.alert('', '保存失败！');
									},// failure
									icon : Ext.Msg.ERROR
								});
							};// isValid
						}
					});
					
					var btn_cancel_add_chart = new top.Ext.Button({
						text : '取消',
						iconCls : 'sy-cancel',
						handler : function() {
							add_chart_window.close();
						}
					});
							
					var add_chart_window = new top.Ext.Window(
							{
								width : 740,
								height : 450,
								layout : 'fit', 
								title : '新增图表',
								iconCls : 'sy-win-flag',
								modal : true,
								tbar : [ btn_sure_add_chart, '-', btn_cancel_add_chart ],
								items : [ chart_form ]
							});
					add_chart_window.show();

				} // end fun()				
				
                /** **************** 修改图表方法 ******************* */
				function mod_chart_fun(fbh, fname, fdesc, tree_op, fstyleStr, frela_bhStr, frela_openStr, fdescStr, frela_yj, frela_type, ffx_openStr, ftargetStr, ffx_bhStr) {
				
					var pxgz_combox = new top.Ext.form.ComboBox({
						id : 'tblx_id',
						name : 'tblx_id',
						mode : 'local',
						fieldLabel : '图表类型',
						valueField : 'tblx_id',
						displayField : 'tblx_name',
						triggerAction : 'all',
						width : 150,
						value : fstyleStr,
						store : new Ext.data.SimpleStore( {
							fields : [ 'tblx_id', 'tblx_name' ],
							data : [ [ 1, '柱状图' ],
								     [ 2, '仪表盘' ], 
								     [ 3, '单折线' ], 
								     [ 4, '横向直线' ], 
								     [ 5, '饼图' ],
								     [ 6, '金字塔' ],
								     [ 7, '漏斗图' ],
								     [ 8, '温度计' ],
								     [ 9, '多折线' ],
								     [ 10, '多序列柱状图 ' ],
								     [ 11, '柱状、折线联合图 ' ],
								     [ 12, '甘特图 ' ]
							] 
						})
					});
					
					var drill_type_Radio = new top.Ext.form.RadioGroup({
                       id:'drill_type_radio_id',
					   style:'width:80px; display: block;text-align:left;line-height:22px;',
					   height:20,
					   
       				   fieldLabel : '展现形式',
                       columns : 2,
                       value : frela_type,
                       vertical :true,
                       items:[
                              {boxLabel:'图表',inputValue:'1',name:'frela_type',checked: true},
                              {boxLabel:'报表',inputValue:'2',name:'frela_type'}],
				        listeners : {
				        	'change' : function(rg, checked){
				        		sqlContent.getEl().dom.readOnly = checked.getGroupValue() == 'yes' ? false : true;
						}}
			    });
					
					//钻取依据
					var zqyj_combox = new top.Ext.form.ComboBox({
						id : 'zqyj_id',
						name : 'zqyj_id',
						mode : 'local',
						fieldLabel : '钻取依据',
						valueField : 'zqyj_id',
						displayField : 'zqyj_name',
						triggerAction : 'all',
						value : frela_yj,
						width : 150,
						store : new Ext.data.SimpleStore( {
							fields : [ 'zqyj_id', 'zqyj_name' ],
							data : [ [ 1, '日期' ],
							         [ 2, ' 日期-年' ],
								     [ 3, ' 日期-季度' ], 
								     [ 4, ' 日期-月度' ], 
								     [ 5, ' 日期-天' ], 
								     [ 8, '科室' ]
							] 
						})
					});  
					
					
					
					var fxOpen_obj = new top.Ext.form.RadioGroup({
						                       id:'ffx_open_id',
											   style:'width:80px; display: block;text-align:left;line-height:22px;',
											   height:20,
						       				   fieldLabel : '文字分析',
						                       columns : 2,
						                       name : 'ffx_open',
						                       value : ffx_openStr,
						                       vertical :true,
						                       items:[
						                              {boxLabel:'关闭',inputValue:'2',name:'ffx_open',checked: true},
						                              {boxLabel:'开启',inputValue:'1',name:'ffx_open'}],
										        listeners : {
										        	'change' : function(rg, checked){
										        		fxOpen_obj.getEl().dom.readOnly = checked.getGroupValue() == 'yes' ? false : true;
												}}
									    });
									    
					var fxBh_obj = new top.Ext.form.RadioGroup({
						                       id:'ffx_bh_id',
											   style:'width:80px; display: block;text-align:left;line-height:22px;',
											   height:20,
						       				   fieldLabel : '分析策略',
						                       columns : 2,
						                       value : ffx_bhStr,
						                       vertical :true,
						                       items:[
						                              {boxLabel:'向下利好',inputValue:'2',name:'ffx_bh',checked: true},
						                              {boxLabel:'向上利好',inputValue:'1',name:'ffx_bh'}],
										        listeners : {
										        	'change' : function(rg, checked){
										        		fxBh_obj.getEl().dom.readOnly = checked.getGroupValue() == 'yes' ? false : true;
												}}
									    });
									    
					var drillOpen_obj = new top.Ext.form.RadioGroup({
						                       id:'ftable_radio_id',
											   style:'width:80px; display: block;text-align:left;line-height:22px;',
											   height:20,
						       				   fieldLabel : '钻取开关',
						                       columns : 2,
						                       value : frela_openStr,
						                       vertical :true,
						                       items:[
						                              {boxLabel:'关闭',inputValue:'2',name:'frela_open',checked: true},
						                              {boxLabel:'开启',inputValue:'1',name:'frela_open'}],
										        listeners : {
										        	'change' : function(rg, checked){
										        		drillOpen_obj.getEl().dom.readOnly = checked.getGroupValue() == 'yes' ? false : true;
												}}
									    })
					
					var chart_form = new top.Ext.form.FormPanel(
							{
								frame : true,
								url : 'reportInfo!updateReportInfo.do',
								method : 'POST',
								labelWidth : 70,
								waitMsgTarget : true,
								layout : "column",
								items : [ {
									columnWidth : 0.4,
									autoHeight : true,
									layout : "form",
									anchor : '99%',
									items : [{
											fieldLabel : '当前操作',
											html : '修改图表' + fname 
										}, {
											xtype : 'textfield',
											fieldLabel : '报表名称',
											name : 'fname',
											id : 'mod_fname_id',
											readOnly : false,
											value : fname,
											allowBlank : true,
											width : 150
										}, pxgz_combox, {
											xtype : 'numberfield',
											fieldLabel : '标准值',
											id : 'mod_ftarget_id',
											value : ftargetStr,
											name : 'ftarget',
											width : 150
										},
										fxOpen_obj ,
										fxBh_obj ,
										drillOpen_obj, 
										drill_type_Radio, {
											xtype : 'textfield',
											fieldLabel : '钻取图表编号',
											name : 'frela_bh',
											readOnly : false,
											allowBlank : true,
											id : 'mod_frela_bh_id',
											value : frela_bhStr,
											width : 150
										}, zqyj_combox, {
											xtype : 'hidden',
											name : 'fbh',
											value : fbh
										}, {
											xtype : 'hidden',
											name : 'fchart_style',
											id : 'mod_fchart_style_id',
											value : fstyleStr
										}, {
											xtype : 'hidden',
											name : 'frela_yj',
											id : 'frela_yj_id'
										}]
										
							}, {
									columnWidth : 0.6,
									autoHeight : true,
									layout : "form",
									labelWidth : 60,
									labelAlign : 'left',
									anchor : '99%',
									items : [  {
											html : '文字分析参考值： ',
											width : 350
										}, {
											html : '　　统计结果总数：total',
											width : 350
										}, {
											html : '　　统计结果平均值：average',
											width : 350
										},{
											html : '　　低于标准值对象个数：obj_num_under',
											width : 350
										},{
											html : '　　高于标准值对象个数：obj_num_above',
											width : 350
										},{
											html : '　　低于标准值对象描述：obj_desc_under',
											width : 350
										},{
											html : '　　高于标准值对象描述：obj_desc_above',
											width : 350
										},{
											html : '　　统计对象总个数：obj_num_all',
											width : 350
										},{
											html : '　　统计对象达标率：rate',
											width : 350
										},{
											html : '　　　    ',
											width : 350
										}, { 
											xtype : 'textarea',
											fieldLabel : '分析内容',
											name : 'fdesc',
											value : fdesc,
											allowBlank : true,
											height : 200,
											width : 350
										} ]
								} ]
								
							});

							
					var btn_sure_mod_chart = new top.Ext.Button({
						text : '确定',
						iconCls : 'sy-sure',
						handler : function() {
						var frm = chart_form.getForm();
						top.Ext.get("mod_fchart_style_id").dom.value = top.Ext.getCmp("tblx_id").value;
						top.Ext.get("frela_yj_id").dom.value = top.Ext.getCmp("zqyj_id").value;
						//top.Ext.get("mod_ffx_open_id").dom.value = top.Ext.getCmp("ffx_open_id").value;
						//alert(top.Ext.get("mod_ffx_open_id").dom.value);
							if (frm.isValid()) {
								frm.submit({
									waitTitle : '请稍候',
									waitMsg : '正在提交表单数据,请稍候...',
									success : function(form, action) {
										mod_chart_window.close();
										tree_op.root.reload();
										top.Ext.Msg.alert('', '保存成功！');
										
									},
									failure : function(form, action) {
										mod_chart_window.close();
										tree_op.root.reload();
										top.Ext.Msg.alert('', '保存失败！');
									},// failure
									icon : Ext.Msg.ERROR
								});
							};// isValid
						}
					});
					
					var btn_cancel_mod_chart = new top.Ext.Button({
						text : '取消',
						iconCls : 'sy-cancel',
						handler : function() {
							mod_chart_window.close();
						}
					});
							
					var mod_chart_window = new top.Ext.Window(
							{
								width : 740,
								height : 440,
								layout : 'fit', 
								title : '修改图表',
								iconCls : 'sy-win-flag',
								modal : true,
								tbar : [ btn_sure_mod_chart, '-', btn_cancel_mod_chart ],
								items : [ chart_form ]
							});
					mod_chart_window.show();

				} // end fun()